<template>
  <div class="chatview-container">
    <!--聊天页面对象头部-->
    <chatviewheader :name='getCurrentChatUsername.name' :action='"more"'></chatviewheader>
    <!--聊天对话组件-->
    <msgcomp
    :showChoose='chageMsg'
    :chatHeadicon='getCurrentChatUsername.headicon || $imHeadIcon'
    :msgList='getCurrentUserChat'
    ></msgcomp>
    <!-- 发送 -->
    <chatsend
    @chagemsg='chageMsgFun'
    :type='"chat"'
    ></chatsend>
  </div>
</template>

<script>
  import chatviewheader from './ChatViewHeader'
  import msgcomp from './MsgComp'
  import chatsend from './ChatSend'
  import {mapGetters} from 'vuex'
  export default {
    data() {
      return {
        chageMsg: false
      }
    },
    components: {
      chatviewheader,
      msgcomp,
      chatsend
    },
    mounted() {
      this.init()
    },
    computed: {
      ...mapGetters(['getCurrentChatUsername', 'getCurrentUserChat'])
    },
    methods: {
      // 初始化你函数
      init() {
        this.$immui.init()
      },
      chageMsgFun(flag) {
        this.chageMsg = flag
      }
    }
  }
</script>

<style lang='scss' scoped>
  /*容器样式*/
.chatview-container{
  z-index: 12;
}
  /*滚动条样式*/
.chat-container{
  bottom: 50px;
}
</style>
